import 'dart:math';

import 'package:word_game/engine/core.dart';
import 'package:word_game/battle/battle.dart';
import 'package:word_game/task/task_core.dart';

class RPGHero extends TaskableHero with Skillable, Battleable, Equipmentable {
  RPGHero(Map map) : super(map) {
    World.instance.add(ViewEquipmentEvent());
    equipmentView = EquipmentView();
    equipmentView.equipments = [
      {EquipmentPart.head:null},
      {EquipmentPart.neck:null},
      {EquipmentPart.chest:null},
      {EquipmentPart.hand:null},
      {EquipmentPart.leg:null},
      {EquipmentPart.foot:null},
      {EquipmentPart.finger1:null},
      {EquipmentPart.finger2:null},
      {EquipmentPart.master_weapon:null},
      {EquipmentPart.assist_weapon:null},
    ];
  }

  @override
  RoleAction determineAction(int round) {
    var index = round % (skills.length+1);
    if (index > 0) {
      SkillAction action = SkillAction();
      action.skill = skills[index-1];
      return action;
    } else {
      return super.determineAction(round);
    }
  }
}